package com.westvalley.service.api.nc;

import java.util.Map;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.westvalley.http.HttpXmlClient;
import com.westvalley.service.api.nc.bean.LoanDoc;

public class LoanService extends NcService{
	public static final String KEY = "loan";
	public static final JsonType jsonType = JsonType.obj;
	private LoanDoc bean;
	
	public static LoanService me(LoanDoc bean){
		return new LoanService(bean);
	}
	
	private LoanService(LoanDoc bean) {
		super(KEY, jsonType);
		this.bean = bean;
	}
	
	@Override
	protected String executeInterface(Map<String, Object> params) {
		String bodyParam = JSON.toJSONString(params);
		return HttpXmlClient.postBody(this.url, bodyParam, "application/json");
	}
	
	@Override
	protected Map<String, Object> initParams() {
		return (JSONObject) JSON.toJSON(this.bean);
	}

}
